package autoorder.zsxmlv.action;

import autoorder.zsxmlv.po.Shop;
import autoorder.zsxmlv.service.ShopService;
import common.zsxmlv.vo.Result;
import common.zsxmlv.vo.Table;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @Author: ZSXM
 * @Description:
 * @Company: DingZheng
 * @Date: Create by 2018/6/20 14:09
 * @Version: 1.0
 * @Modify by:
 */
@Controller
@ResponseBody
@RequestMapping("/admin/auto_order/shop")
public class ShopAction {

    @Resource
    private ShopService shopService;

    @RequestMapping("/insert")
    public Result insert(Shop shop) {
        return shopService.insert(shop);
    }

    @RequestMapping("/getShopById")
    public Result getShopById(Integer id) {
        return shopService.getShopById(id);
    }

    @RequestMapping("/delete")
    public Result delete(Integer id) {
        return shopService.deleteShop(id);
    }

    @RequestMapping("/selectByPage")
    public Table selectByPage(Integer page, Integer limit, String keyword) {
        return shopService.selectByPage(page, limit, keyword);
    }

    @RequestMapping("/selectByAll")
    public Table selectByAll() {
        return shopService.selectByAll();
    }

    @RequestMapping("/updateShopById")
    public Result updateShopById(Shop shop) {
        return shopService.modifyShop(shop);
    }
}
